package com.yang.Inet.test;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class UDPSendTest2 {

	public static void main(String[] args) throws Throwable {
		DatagramSocket ds = new DatagramSocket();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String link = null;

		while ((link = br.readLine()) != null) {
			byte[] bytes = link.getBytes();
			DatagramPacket dp = new DatagramPacket(bytes, bytes.length, InetAddress.getByName("192.168.30.255"), 10000);

			ds.send(dp);
			if (link.equals("886")) {
				break;
			}

		}

//		ds.close();
	}

	// 建立发送位置
	public void test1() throws Throwable {

	}
}
